# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=malheur
pkgver=0.5.4
pkgrel=2
groups=('blackarch' 'blackarch-forensic' 'blackarch-malware')
pkgdesc='A tool for the automatic analyze of malware behavior.'
arch=('x86_64' 'aarch64')
url='http://www.mlsec.org/malheur/'
license=('GPL3')
depends=('libconfig>=1.4' 'libarchive>=2.70')
makedepends=('uthash>=1.7')
source=("http://www.mlsec.org/$pkgname/files/$pkgname-$pkgver.tar.gz")
sha512sums=('c2589d719b546320722ae73e38ca8e8b001443f4c00aa9fa58a4e73649cf70d386235a59e839ede0502645bac5141b23dd652f8fac8f7597976a3dc7472272d7')

build() {
  cd "$pkgname-$pkgver"

  if [[ "$CARCH" == "i686" || "$CARCH" == "x86_64" ]];
  then
    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
      --enable-openmp
  else
    ./configure --prefix=/usr --build=arm --sysconfdir=/etc \
      --localstatedir=/var --enable-openmp
  fi

  make
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install

  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" CHANGES INSTALL
}

